package com.binest.projectInclusionMain.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.projectInclusionMain.mapper.ProjectInclusionMainMapper;
import com.binest.projectInclusionMain.domain.ProjectInclusionMain;
import com.binest.projectInclusionMain.service.IProjectInclusionMainService;

/**
 * 项目收录主Service业务层处理
 * 
 * @author wwd
 * @date 2024-01-24
 */
@Service
public class ProjectInclusionMainServiceImpl implements IProjectInclusionMainService 
{
    @Autowired
    private ProjectInclusionMainMapper projectInclusionMainMapper;

    /**
     * 查询项目收录主
     * 
     * @param id 项目收录主主键
     * @return 项目收录主
     */
    @Override
    public ProjectInclusionMain selectProjectInclusionMainById(String id)
    {
        return projectInclusionMainMapper.selectProjectInclusionMainById(id);
    }

    /**
     * 查询项目收录主列表
     * 
     * @param projectInclusionMain 项目收录主
     * @return 项目收录主
     */
    @Override
    public List<ProjectInclusionMain> selectProjectInclusionMainList(ProjectInclusionMain projectInclusionMain)
    {
        return projectInclusionMainMapper.selectProjectInclusionMainList(projectInclusionMain);
    }

    /**
     * 新增项目收录主
     * 
     * @param projectInclusionMain 项目收录主
     * @return 结果
     */
    @Override
    public int insertProjectInclusionMain(ProjectInclusionMain projectInclusionMain)
    {
        projectInclusionMain.setCreateTime(DateUtils.getNowDate());
        return projectInclusionMainMapper.insertProjectInclusionMain(projectInclusionMain);
    }

    /**
     * 修改项目收录主
     * 
     * @param projectInclusionMain 项目收录主
     * @return 结果
     */
    @Override
    public int updateProjectInclusionMain(ProjectInclusionMain projectInclusionMain)
    {
        projectInclusionMain.setUpdateTime(DateUtils.getNowDate());
        return projectInclusionMainMapper.updateProjectInclusionMain(projectInclusionMain);
    }

    @Override
    public int addLikeCount(String id) {
        return projectInclusionMainMapper.addLikeCount(id);
    }

    @Override
    public int reduceLikeCount(String id) {
        return projectInclusionMainMapper.reduceLikeCount(id);
    }

    @Override
    public int addNoLikeCount(String id) {
        return projectInclusionMainMapper.addNoLikeCount(id);
    }

    @Override
    public int reduceNoLikeCount(String id) {
        return projectInclusionMainMapper.reduceNoLikeCount(id);
    }

    /**
     * 批量删除项目收录主
     * 
     * @param ids 需要删除的项目收录主主键
     * @return 结果
     */
    @Override
    public int deleteProjectInclusionMainByIds(String[] ids)
    {
        return projectInclusionMainMapper.deleteProjectInclusionMainByIds(ids);
    }

    /**
     * 删除项目收录主信息
     * 
     * @param id 项目收录主主键
     * @return 结果
     */
    @Override
    public int deleteProjectInclusionMainById(String id)
    {
        return projectInclusionMainMapper.deleteProjectInclusionMainById(id);
    }
}
